/* ************************************************************************
> File Name:     main8.c
> Author:        zhfu
> mail:          3346897597@qq.com
> Created Time:  2022年05月04日 星期三 23时11分43秒
> Description:   
 ************************************************************************/
#include<stddef.h>
#include<time.h>
#include<stdlib.h>
#include<stdio.h>
#include"stringhash.h"

int func(char *x)
{
    int ret = 0;
    char *p = x;
    while (*p){
        ret += *p;
        ++p;
    }
    return ret;
}

int main(void)
{
    my_hash h = {NULL, 11, func, NULL, 0};

    insert(&h, "vsv");
    insert(&h, "rfw");
    insert(&h, "zhfu");
    insert(&h, "rfw");
    print_hash(h);

    puts("------------");
    delete(&h, "rfw");
    delete(&h, "rfw");
    insert(&h, "rfw");
    print_hash(h);
    free_hash(&h);

    return 0;
}
